﻿<Controls1:PhoneApplicationPage x:Class="TexasHoldemCalculator.View.CalculatorView"
                                xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                                xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                                xmlns:Controls1="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
                                xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                                xmlns:holdem="clr-namespace:Holdem.Core.Controls;assembly=Holdem.Core"
                                xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                                xmlns:MvvmLite="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71"
                                xmlns:Custom="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
                                xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI"
                                x:Name="CalculatorViewPage"
                                ApplicationBar="{StaticResource GlobalApplicationBar}"
                                d:DesignHeight="800"
                                d:DesignWidth="480"
                                DataContext="{Binding Main,
                                                      Source={StaticResource Locator}}"
                                Style="{StaticResource DefaultPageTransition}"
                                SupportedOrientations="Portrait"
                                mc:Ignorable="d">
    <Grid x:Name="LayoutRoot">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="480*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="145" />
                <RowDefinition Height="165" />
                <RowDefinition Height="125" />
                <RowDefinition Height="135" />
                <RowDefinition Height="70" />
                <RowDefinition Height="85" />
            </Grid.RowDefinitions>

            <holdem:HoldemFlopCardButtonControl x:Name="FlopHandsStackPanel"
                                                HorizontalAlignment="Center"
                                                CardImageCommandFive="{Binding ShowRiverCommand}"
                                                CardImageCommandFour="{Binding ShowTurnCommand}"
                                                CardImageCommandOne="{Binding ShowFlopCommand}"
                                                CardImageCommandThree="{Binding ShowFlopCommand}"
                                                CardImageCommandTwo="{Binding ShowFlopCommand}"
                                                ItemSource="{Binding HoldemHandCards}"
                                                Orientation="Horizontal" />

            <TextBlock x:Name="RankingTextBlock"
                       Grid.Row="1"
                       Style="{StaticResource THCStatsLargeHeaderText}"
                       Text="{Binding HandValuation}"
                       Visibility="{Binding HandRankVisibility}" />

            <holdem:HoldemHoleCardsControl x:Name="HoldemHoleCardsControl"
                                           Grid.Row="2"
                                           HorizontalAlignment="Center"
                                           ItemSource="{Binding HoldemHoleCards}"
                                           Orientation="Horizontal" />

            <Button x:Name="NewHandButton"
                    Grid.Row="3"
                    Width="155"
                    Height="55"
                    Content="New Hand"
                    Style="{StaticResource RoundButtonStyle}">
                <Custom:Interaction.Triggers>
                    <Custom:EventTrigger EventName="Click">
                        <MvvmLite:EventToCommand x:Name="NewHandButtonOnClick" Command="{Binding GenerateHandCommand}" />
                    </Custom:EventTrigger>
                </Custom:Interaction.Triggers>
            </Button>

            <ToggleButton x:Name="HoldemHandValuation"
                          Grid.Row="4"
                          HorizontalAlignment="Center"
                          VerticalAlignment="Center"
                          BorderBrush="{StaticResource THCTransparentBrush}"
                          BorderThickness="0"
                          Content="[ Show Best Hand ]"
                          IsChecked="{Binding IsHandRankVisible,
                                              Mode=TwoWay}">
                <!--
                    Custom:Interaction.Triggers>
                    <Custom:EventTrigger EventName="Click">
                    <MvvmLite:EventToCommand x:Name="RankVisibilityCommand" Command="{Binding VisibilityCommand}" />
                    </Custom:EventTrigger>
                    </Custom:Interaction.Triggers
                -->
            </ToggleButton>

            <my:AdControl x:Name="THCStatisticsAd"
                          Grid.Row="5"
                          Width="{Binding Width}"
                          Height="{Binding Height}"
                          Margin="0"
                          VerticalAlignment="Center"
                          DataContext="{Binding Source={StaticResource Locator},
                                                Path=AdProvider}" />
        </Grid>

        <!--
            <Border x:Name="HandRankPopup"
            d:IsHidden="True"
            Style="{StaticResource OutsPopupBorderStyle}"
            Visibility="{Binding Visibility}">
            <Grid>
            <Grid.ColumnDefinitions>
            <ColumnDefinition Width="480*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
            <RowDefinition Height="145" />
            <RowDefinition Height="165" />
            <RowDefinition Height="125" />
            <RowDefinition Height="135" />
            <RowDefinition Height="75" />
            <RowDefinition Height="80" />
            </Grid.RowDefinitions>
            
            <holdem:HoldemFlopCardButtonControl x:Name="BestHandsStackPanel"
            HorizontalAlignment="Center"
            ItemSource="{Binding Path=BestPossibleHand.BestFiveHand}"
            Orientation="Horizontal" />
            
            <TextBlock x:Name="HandRankingTextBlock"
            Grid.Row="1"
            Style="{StaticResource THCStatsLargeHeaderText}"
            Text="{Binding HandValuation}"
            Visibility="{Binding IsHandRankVisible}" />
            
            <holdem:HoldemHoleCardsControl x:Name="BestHoleCardsControl"
            Grid.Row="2"
            HorizontalAlignment="Center"
            ItemSource="{Binding Path=BestPossibleHand.Remainder}"
            Orientation="Horizontal" />
            
            <Button x:Name="HandRankPopupSelectButton"
            Grid.Row="5"
            Width="48"
            Height="48"
            HorizontalAlignment="Center"
            Style="{StaticResource RoundButtonCircleStyle}">
            <Image x:Name="ImageRankSelect" Source="../Images/Icons/48/appbar.check.rest.png" />
            <Custom:Interaction.Triggers>
            <Custom:EventTrigger EventName="Click">
            <MvvmLite:EventToCommand x:Name="RankVisibilitySelectCommand" Command="{Binding VisibilityCommand}" />
            </Custom:EventTrigger>
            </Custom:Interaction.Triggers>
            </Button>
            
            </Grid>
            </Border>
        -->

    </Grid>
</Controls1:PhoneApplicationPage>